<?php 

namespace Cli\Event;
use Think\Log;

abstract class CronEvent
{

    static $Instance = null;

    static public function instance($task)
    {
        if (empty(self::$Instance[$task])){
            $eventName = ucfirst($task).'Cron';
            $TaskEvent = A($eventName,'Event');
            if ($TaskEvent instanceof CronEvent){
                self::$Instance[$task] = $TaskEvent;
            }
        }
        return self::$Instance[$task];
    }

    abstract public function run();
}